<!DOCTYPE html>
<html xmlns:v-on="http://www.w3.org/1999/xhtml" xmlns:v-popover="http://www.w3.org/1999/xhtml"
      xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=0">
    <title>用户管理</title>
    <link rel="stylesheet" href="../lib/basic/css/bootstrap.min.css">
    <link type="text/css" href="../home/css/sellsenter.css" rel="stylesheet" />
    <link href="../home/css/useradmin.css" type="text/css" rel="stylesheet" />
    <link href="../lib/AmazeUI-2.4.2/assets/css/amazeui.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" type="text/css" href="../lib/elementui/1.4.3/theme-default/index.css">
    <script src="../lib/AmazeUI-2.4.2/assets/js/jquery.min.js"></script>
    <script src="../home/js/bootstrap.min.js"></script>
    <script src="../home/js/vue.min.js"></script>
    <script src="../lib/elementui/1.4.3/index.js"></script>
    <script src="../charge/moment.js"></script>
</head>
<body>
<div id="useradmin">
    <div align="center">
        <span style="color: blue;font-weight: bold;font-size:24px">用户信息</span>
    </div>
    <div  style="margin-left: 35px;">
        <input type="button" v-on:click="UpdateAddData(0,0);" class="am-btn am-btn-primary am-radius"  value="新增" style="height: 33px;border-radius: 4px;padding-top: 6px;"/>
        <div style="float: right">
            <el-radio-group v-model="useradmin.label"  size="small  ">
                <el-radio-button label="用户信息"></el-radio-button>
                <el-radio-button label="商家信息"></el-radio-button>
            </el-radio-group>
            <input type="text" id="search" placeholder="仅可搜索单位名称或公司名称" title="仅可搜索单位名称或公司名称" style="height: 33px;position: relative; width: 305px;border-radius: 4px;border: solid 1px #d1dbe5;top:-2px;"/>
            <input type="button" value="搜索" v-on:click="search();"  style="width: 80px;height: 32px;border-radius: 4px;position: relative;left: -84px;top:-3px;">
        </div>
    </div>
    <template>
        <el-table :data="userInformation.slice((currentPages-1)*pagesizes,currentPages*pagesizes)" border stripe   align="center" width="100%">
            <el-table-column  prop="username" label="帐号" show-overflow-tooltip align="center">
            </el-table-column>
            <el-table-column prop="name" label="单位名称"  show-overflow-tooltip align="center">
            </el-table-column>
            <el-table-column prop="xmname" label="联系人" show-overflow-tooltip align="center">
            </el-table-column>
            <el-table-column prop="telephone" label="电话"  show-overflow-tooltip align="center">
            </el-table-column>
            <el-table-column prop="email" label="邮箱" show-overflow-tooltip align="center">
            </el-table-column>
            <el-table-column prop="createDt" label="注册时间"  show-overflow-tooltip align="center">
            </el-table-column>
            <el-table-column prop="enabled" label="帐号是否可用" :formatter="formatTime"  show-overflow-tooltip align="center">
            </el-table-column>
            <el-table-column  label="操作" width="200"  style="text-align: center" align="center">
                <template slot-scope="scope">
                    <el-tag id="submit" v-on:click.native="UpdateAddData(scope.row,1);" type="success" round><a href="javascript:void(0);">修改</a></el-tag>
                    <el-tag style="width: 54px;text-align: center;" id="block"   v-if="scope.row.enabled ==true" :plain="true"  @click.native="blockUser(scope.row);" type="warning" round><a href="javascript:void(0);">停用 </a></el-tag>
                    <el-tag style="width: 54px; text-align: center;" id="start"  v-if="scope.row.enabled ==false" :plain="true" @click.native="startUser(scope.row);" type="primary" round><a href="javascript:void(0);">启用</a></el-tag>
                    <el-tag :plain="true"  v-on:click.native="resetUser(scope.row);" style="width: 70px;margin-top: -2px;text-align: center;" type="info" plain><a href="javascript:void(0);">重置密码</a></el-tag>
                </template>
            </el-table-column>
        </el-table>
        <el-pagination @size-change="handleSizeChange(size,0)" @current-change="handleCurrentChange(currentPages,0)"   :page-sizes="[10, 20, 30, 40]" :current-page.sync="currentPages" :page-size="pagesizes" layout="total, prev, pager, next" :total="userInformation.length" align="right" style="margin-right: 50px;"></el-pagination>
    </template>
    <div align="center">
        <span  style="color:blue;font-weight:bold; font-size:24px">商家信息</span>
    </div>
    <template>
        <el-table :data="Merchants.slice((currentPage-1)*pagesize,currentPage*pagesize)" border stripe @row-click="sellDetail"   align="center" style="margin-bottom: 20px;"  width="100%">
             <el-table-column type="expand">
                <template slot-scope="scope">
                    <el-form label-position="left" inline class="demo-table-expand">
                        <el-form-item label="帐号：">
                            <span>{{ sysUser.username }}</span>
                        </el-form-item>
                        <el-form-item label="用户名：">
                            <span>{{ sysUser.name}}</span>
                        </el-form-item>
                        <el-form-item label="修改时间：">
                            <span>{{ scope.row.updateTime }}</span>
                        </el-form-item>
                        <el-form-item label="身份证号：">
                            <span>{{ scope.row.idCardNo }}</span>
                        </el-form-item>
                        <el-form-item label="统一社会信用代码：">
                            <span>{{ scope.row.institutionCode }}</span>
                        </el-form-item>
                        <el-form-item label="经营模式：">
                            <span>{{ scope.row.businessModel }}</span>
                        </el-form-item>
                        <el-form-item label="公司LOGO：">
                            <img id="imgLogo" :src="scope.row.companyLogo" :title="scope.row.companyName">
                        </el-form-item>
                    </el-form>
                </template>
            </el-table-column>
            <el-table-column  prop="companyName" label="公司名称"  show-overflow-tooltip align="center">
            </el-table-column>
            <el-table-column prop="xmname" label="联系人"  show-overflow-tooltip align="center">
            </el-table-column>
            <el-table-column prop="tel" label="电话"  show-overflow-tooltip align="center">
            </el-table-column>
            <el-table-column prop="mail" label="邮箱"  show-overflow-tooltip align="center">
            </el-table-column>
            <el-table-column prop="affiliatedRegional" label="公司地址"  show-overflow-tooltip align="center">
            </el-table-column>
            <el-table-column prop="creationTime" label="创建时间"  show-overflow-tooltip align="center">
            </el-table-column>
            <el-table-column  label="操作" width="200" style="text-align: center" align="center">
                <template slot-scope="scope">
                    <el-tag style="width: 70px;margin-top: -2px;" :plain="true" @click.native="freeze(scope.row);" type="primary" round><a href="javascript:void(0);">冻结帐号</a></el-tag>
                    <el-tag :plain="true"  v-on:click.native="resetUser(scope.row);" style="width: 70px;margin-top: -2px;" type="info" plain><a href="javascript:void(0);">重置密码</a></el-tag>
                </template>
            </el-table-column>

        </el-table>
        <el-pagination @size-change="handleSizeChange(size,1)" @current-change="handleCurrentChange(currentPage,1)"   :page-sizes="[10, 20, 30, 40]" :current-page.sync="currentPage" :page-size="pagesize" layout="total, prev, pager, next" :total="Merchants.length" align="right" style="margin-right: 50px;"></el-pagination>
    </template>
</div>
</body>
<script type="text/javascript" src="../charge/useradmin.js"></script>
</html>